home *** CD-ROM | disk | FTP | other *** search
/ Amiga Games Extra 1996 September / Amiga Games Extra CD-ROM 9-1996.iso / c / hip < prev    next >
Text File  |  1980-03-23  |  6KB  |  244 lines

  1. /* FuNNy HippoPlayer aka SlideSHOW - Eli0t/cONTORTIOn (c) 01/07/96
  2.  
  3.       configure the following and be sure you have NO start-up
  4.      PROGRAM "ON" and your playing mode is "MODULE REPEATEDLY",
  5.    also the display mode MUST be "Time/duration, pos/len", because
  6.         only in this mode REXX can retrieve the playing time!
  7.  
  8.    Don't kick my ass for the use of "signal" command - it's funny!
  9.  
  10.                                                             - Eli0t - */
  11.  
  12.  
  13.  
  14. MAXTIME='360'                /* maximal time limit */
  15. RNDTIME='18'                 /* time to wait on the starting track */
  16.  
  17. PRELOAD='7'                  /* "preload" time */
  18. ZIPSTAT='0'                  /* start-up ZIP status */
  19.  
  20. CBINARY='C:hip'              /* HippoPlayer path + name => fullpath */
  21. PROGRAM='MODS:progs/hippo'   /* "slideshow" Hippo-program to be played */
  22.  
  23.  
  24. /* if ya TOUCH the following "code", let me know at <eliot@sci.muni.cz> */
  25.  
  26.  
  27.  
  28. SIGNAL ON break_c
  29. SIGNAL ON failure
  30. SIGNAL ON syntax
  31. SIGNAL ON halt
  32.  
  33. options results
  34. parse arg FILENAME
  35.  
  36. if getclip('HippoFuNNyPlayer')=='PLAYING' then
  37. call setclip('HippoFuNNyPlayer','FUCKOFF')
  38.  
  39. cliploop:
  40. if getclip('HippoFuNNyPlayer')~=='' then signal cliploop:
  41. call setclip('HippoFuNNyPlayer','PLAYING')
  42.  
  43.  
  44. call random(,,time(s))
  45.  
  46. if ~show("p","HIPPOPLAYER") then
  47. do
  48.      say 'EXECUTING THE HIPPO BINARY'
  49.      address 'COMMAND'
  50.      CBINARY
  51.      address
  52. end
  53.  
  54. hiploop:
  55. if ~show("p","HIPPOPLAYER") then signal hiploop
  56.  
  57. if pos(':',filename)=0 then
  58. do
  59.      address 'HIPPOPLAYER'
  60.      zip ZIPSTAT
  61.      loadprg PROGRAM
  62.      address
  63.  
  64.      WAITER=1
  65.      NUMSNG=1
  66.      STARTPOS=1
  67.  
  68.      JMENO=''
  69.      STARTCAS=time(s)
  70.  
  71. mainloop1:
  72. if ~show("p","HIPPOPLAYER") then signal halt
  73.  
  74.      if NUMSNG=1 then
  75.      do
  76.           say ''
  77.           say 'LOADING RANDOM MODULE...'
  78.           if ~show("p","HIPPOPLAYER") then signal halt
  79.           address 'HIPPOPLAYER'
  80.           randplay
  81.           CLEARING=1
  82.           get cspo
  83.           STARTPOS=result
  84.           STARTCAS=time(s)
  85.           address
  86.      end
  87.      else
  88.      do
  89.           if ~show("p","HIPPOPLAYER") then signal halt
  90.           address 'HIPPOPLAYER'
  91.           get csng
  92.           k=result
  93.           address
  94.           MEMO.k=1
  95.           k=random(1,NUMSNG)
  96.           j=k
  97.           if MEMO.k=1 then
  98.                do k=j to (NUMSNG-1) until MEMO.k=0
  99.                end
  100.           if MEMO.k=1 then
  101.                do k=1 to (j-1) until MEMO.k=0
  102.                end
  103.           if MEMO.k=1 then
  104.           do
  105.                if ~show("p","HIPPOPLAYER") then signal halt
  106.                CLEARING=1
  107.                say ''
  108.                say 'ALL MULTIS PLAYED!'
  109.                say 'LOADING RANDOM MODULE...'
  110.                address 'HIPPOPLAYER'
  111.                randplay
  112.                get nsng
  113.                if result>1 then CLEARING=1
  114.                else CLEARING=0
  115.                get cspo
  116.                STARTPOS=result
  117.                STARTCAS=time(s)
  118.                address
  119.           end
  120.           else
  121.           do
  122.                if ~show("p","HIPPOPLAYER") then signal halt
  123.                CLEARING=0
  124.                address 'HIPPOPLAYER'
  125.                stop
  126.                songplay k
  127.                get cspo
  128.                STARTPOS=result
  129.                STARTCAS=time(s)
  130.                address
  131.                say 'Song:' k
  132.           end
  133.      end
  134.  
  135.      if ~show("p","HIPPOPLAYER") then signal halt
  136.      address 'HIPPOPLAYER'
  137.      get mspo
  138.      MAXPOS=result
  139.      get dura
  140.      if result>0 then WAITER=result-PRELOAD
  141.           else WAITER=random(3 * (MAXPOS-STARTPOS),(10 * (MAXPOS-STARTPOS)))
  142.      if WAITER<40 then WAITER=40+random(1,30)
  143.      if WAITER>=MAXTIME then WAITER=MAXTIME
  144.      get curr
  145.      JMENO=result
  146.      get nsng
  147.      NUMSNG=result
  148.      address
  149.      if CLEARING=1 then say '['JMENO']' NUMSNG 'song(s) | timeout:' WAITER
  150.      else say 'timeout:' WAITER
  151.  
  152.      if CLEARING=1 then
  153.      do i=1 to NUMSNG
  154.           MEMO.i=0
  155.      end
  156.  
  157. mainloop2:
  158.      if getclip('HippoFuNNyPlayer')=='FUCKOFF' then signal stop
  159.      if ~show("p","HIPPOPLAYER") then signal halt
  160.      address 'HIPPOPLAYER'
  161.      get play
  162.      address
  163.      if result~=1 then signal stop
  164.      if ~show("p","HIPPOPLAYER") then signal halt
  165.      address 'HIPPOPLAYER'
  166.      get curr
  167.      address
  168.      if result~=JMENO then
  169.      do
  170.           if ~show("p","HIPPOPLAYER") then signal halt
  171.           address 'HIPPOPLAYER'
  172.           get mspo
  173.           MAXPOS=result
  174.           get cspo
  175.           STARTPOS=result
  176.           get curr
  177.           JMENO=result
  178.           get dura
  179.           if result>0 then WAITER=result-PRELOAD
  180.                else WAITER=random(3 * (MAXPOS-STARTPOS),(10 * (MAXPOS-STARTPOS)))
  181.           if WAITER<40 then WAITER=40+random(1,30)
  182.           if WAITER>=MAXTIME then WAITER=MAXTIME
  183.           address
  184.           if ~show("p","HIPPOPLAYER") then signal halt
  185.           address 'HIPPOPLAYER'
  186.           get nsng
  187.           NUMSNG=result
  188.           address
  189.           STARTCAS=time(s)
  190.           say '['JMENO']' NUMSNG 'song(s) | timeout:' WAITER
  191.           do i=1 to NUMSNG
  192.                MEMO.i=0
  193.           end
  194.      end
  195.      if NUMSNG>1 then
  196.      do
  197.           if ~show("p","HIPPOPLAYER") then signal halt
  198.           address 'HIPPOPLAYER'
  199.           get cspo
  200.           CURRPOS=result
  201.           if CURRPOS=STARTPOS then
  202.           do
  203.                if (time(s)>(STARTCAS+RNDTIME)) then
  204.                do
  205.                     STARTCAS=time(s)
  206.                     WAITER=0
  207.                end
  208.           end
  209.           else STARTPOS=0
  210.           address
  211.      end
  212.  
  213.      CAS=time(s)
  214.      if (CAS-STARTCAS)>=WAITER then signal mainloop1
  215.      else signal mainloop2
  216.  
  217. end
  218. else
  219. do
  220.      say 'PLAYING:' FILENAME
  221.      if ~show("p","HIPPOPLAYER") then signal halt
  222.      address 'HIPPOPLAYER'
  223.      play FILENAME
  224.      address
  225. end
  226. signal blah
  227.  
  228. stop:
  229. say ''
  230. say 'STOPPED!'
  231. signal blah
  232.  
  233. syntax:
  234. break_c:
  235. failure:
  236. halt:
  237. say ''
  238. say 'TERMINATING on line:' SIGL
  239.  
  240. blah:
  241. if getclip('HippoFuNNyPlayer')~=='' then
  242.      call setclip('HippoFuNNyPlayer','')
  243. exit
  244.